<?php

namespace app\common\model\subscribe;

use think\Model;

class SubscribeSettings extends Model
{

    // 默认表名
    protected $name = 'subscribe_settings';

    protected $pk = "user_id";

    /**
     * @param $value
     * @return mixed
     */
    public function getYearlyAttr($value): array
    {
        return json_decode($value, true);
    }

    /**
     * @param $value
     * @return mixed
     */
    public function getQuarterlyAttr($value): array
    {
        return json_decode($value, true);
    }

    /**
     * @param $value
     * @return mixed
     */
    public function getMonthlyAttr($value): array
    {
        return json_decode($value, true);
    }


    /**
     * 实例化表
     * @return SubscribeSettings
     */
    public static function initModel(): static
    {
        return new static();
    }
}